#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/12/26 22:10
# @Author: 周健
# @Email: 907614893@qq.com
# @File：Index_page.py
from pages.base_page import BasePage
from selenium.webdriver.common.by import By


class JingXuanPage(BasePage):
    # 定位器
    search_locator = (By.ID,'com.gfeng.daydaycook:id/searchEt')
    jiaozi_locator = (By.XPATH,'//android.support.v7.widget.RecyclerView[@resource-id=\"com.gfeng.daydaycook:id/rv_daily\"]/android.widget.LinearLayout[2]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]')
    classify_locator = (By.XPATH,'//android.widget.TextView[@text=\"食谱分类\"]')
    more_locator = (By.XPATH,'//android.widget.TextView[@resource-id=\"com.gfeng.daydaycook:id/iv_more\"]')
    huodong_locator = (By.ID,'com.gfeng.daydaycook:id/iv_bg')
    hall_locator = (By.XPATH,'//android.support.v7.widget.RecyclerView[@resource-id=\"com.gfeng.daydaycook:id/recyclerview\"]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]')

    # 搜索框
    def search_cook(self):
        self.driver.find_element(*self.search_locator).click()
    # 点击白玉饺子
    def click_jiaozi(self):
        self.driver.find_element(*self.jiaozi_locator).click()
    # 点击食谱分类
    def click_classify(self):
        self.driver.find_element(*self.classify_locator).click()
    # 点击视频精选的more
    def click_more(self):
        self.driver.find_element(*self.more_locator).click()
    # 点击活动
    def click_huodong(self):
        self.driver.find_element(*self.huodong_locator).click()
    # 点击体验馆
    def click_hall(self):
        self.driver.find_element(*self.hall_locator).click()




